<div class="layui-form" lay-filter="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">

  <script type="text/html" template>
    <input type="text" name="userId" value="{{ d.params.userId || '' }}" style="display: none;">
  </script>


  <div class="layui-form-item">
    <label class="layui-form-label">登录名</label>
    <div class="layui-input-inline">
      <script type="text/html" template lay-done="layui.data.done(d.params);">
        <input type="text" name="userName" value="{{ d.params.userName || '' }}" lay-verify="required|nickname"
          placeholder="请输入用户名" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>

  <script type="text/html" template>
    {{# if(d.params.userName == null ) { }}

  <div class="layui-form-item">
    <label class="layui-form-label">初始密码</label>
    <div class="layui-input-inline">
        <input type="password" name="password"  lay-verify="required|pass" placeholder="请输入初始密码" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">确认初始密码</label>
    <div class="layui-input-inline">
        <input type="password" name="password2"  lay-verify="required|pass" placeholder="请输入初始密码" autocomplete="off" class="layui-input">
    </div>
  </div>

  {{# } }}
</script>

  <div class="layui-form-item">
    <label class="layui-form-label">角色</label>
    <div class="layui-input-inline">
        <div id="LAY-user-admin-list-form-roleSelect" class="xm-select-demo"></div>
    </div>
  </div>

  <script type="text/html" template>
    {{# if(d.params.isLock != null && d.params.roleName != "管理员") { }}
  <div class="layui-form-item">
    <label class="layui-form-label">账号状态</label>
    <div class="layui-input-inline">
        <input type="checkbox" lay-filter="switch" name="isLock" {{ d.params.isLock == 1 ? 'checked' : '' }} value="1"
          lay-skin="switch" lay-text="锁定|正常">
    </div>
  </div>
  {{# } }}
</script>

  <div class="layui-form-item">
    <label class="layui-form-label"></label>
    <div class="layui-input-inline">
      <input type="button" lay-submit lay-filter="LAY-user-back-submit" value="确认" class="layui-btn">
    </div>
  </div>
</div>

<script>
  layui.data.done = function (d) {
    layui.use(['admin', 'form','xmSelect'], function () {
      var $ = layui.$,
        form = layui.form
        ,setter = layui.setter
        ,admin = layui.adminl
        ,xmSelect = layui.xmSelect;

      var ok = setter.response.statusCode.ok;
      var fail = setter.response.statusCode.fail;
      var error = setter.response.statusCode.error;




    });
  }
</script>